<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta name="baidu-site-verification" content="code-UjJKh3jtOo">
  <link rel="stylesheet" href="//unpkg.com/@highlightjs/cdn-assets@11.5.0/styles/atom-one-dark.min.css">
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
  <title>Tit1e</title>
  <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2767111597631391" crossorigin="anonymous"></script>
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/atom.xml" title="Tit1e" type="application/atom+xml">
</head>

<body class="dark">
    <div class="container">
    <header class="header">
  <div class="title">
      <a href="/" class="logo">Tit1e</a>
      <div class="btn-dark"></div>
      <script>
        let bodyClx = document.body.classList;
        let btnDark = document.querySelector('.btn-dark');
        let sysDark = window.matchMedia('(prefers-color-scheme: dark)');
        let darkVal = localStorage.getItem('dark');

        let setDark = (isDark) => {
        bodyClx[isDark ? 'add' : 'remove']('dark');
        localStorage.setItem('dark', isDark ? 'yes' : 'no');
        };

        setDark(darkVal ? darkVal === 'yes' : sysDark.matches);
        requestAnimationFrame(() => bodyClx.remove('not-ready'));

        btnDark.addEventListener('click', () => setDark(!bodyClx.contains('dark')));
        sysDark.addEventListener('change', (event) => setDark(event.matches));
      </script>
  </div>
    <ul class="menu">
        
        
        
        
        <li class="menu-item ">
            <a href="/" class="menu-item-link">Home</a>
        </li>
        
        
        <li class="menu-item ">
            <a href="/archives/" class="menu-item-link">Archives</a>
        </li>
        
        
        <li class="menu-item ">
            <a href="/atom.xml" class="menu-item-link">RSS</a>
        </li>
        
        
        <li class="menu-item ">
            <a target="_blank" rel="noopener" href="https://pixeltimer.art" class="menu-item-link">Pixel Timer</a>
        </li>
        
    </ul>
    <div class="search-box">
        <input type="search" id="search" placeholder="搜索">
    </div>
</header>
    <article class="post">
  <div class="post-meta">
    <span class="post-time">5 / 30, 2021</span>
  </div>
  <div class="post-title">
    <h1 class="title">Mac 出现应用无法打开的一些请况处理方式总结</h1>
  </div>
  
  <ul class="post-tags">
    
    <li class="tag-item">
      #mac
    </li>
    
  </ul>
  
  <div class="post-content">
    <p>使用 Mac 时，我们总会装一些 app store 之外的应用，而这些来自第三方的应用在安装打开后经常会出现应用无法打开的情况。我遇到的主要两种：</p>
<h3 id="情况一"><a href="#情况一" class="headerlink" title="情况一"></a>情况一</h3><blockquote>
<p>打不开XXX，因为它来自身份不明的开发者</p>
</blockquote>
<p>这种错误只会出现在 macOS Mojave 10.14 及以下版本。</p>
<h4 id="解决方式"><a href="#解决方式" class="headerlink" title="解决方式"></a>解决方式</h4><p>打开终端，输入：</p>
<pre><code class="shell">sudo spctl --master-disable
</code></pre>
<p>然后回车，会提示你输入密码，密码就是你的开机锁屏密码。密码输入不会显示在界面上，只需正常输完回车就行，但需要注意输入法是否是英文键盘。</p>
<p>打开【系统偏好设置】-【安全与隐私】-【通用】确认一下，没输之前状态可能是这样的：</p>
<p><img src="https://personal-1251959693.cos.ap-chengdu.myqcloud.com/2021-05-30-152354.png"></p>
<p>输完后重新进入【安全与隐私】应该就是下图状态：</p>
<p><img src="https://personal-1251959693.cos.ap-chengdu.myqcloud.com/2021-05-30-152601.png"></p>
<p>然后可以尝试重新打开应用。</p>
<h3 id="情况二"><a href="#情况二" class="headerlink" title="情况二"></a>情况二</h3><blockquote>
<p>xxx已损坏，无法打开，您应该将它移到废纸篓</p>
</blockquote>
<p>这种错误只出现在版本在 10.15 及以上的系统中，因为 Apple 对未签名的应用权限又缩紧了。macOS Mojave 10.14 及以下版本，只需将“允许任意来源”打开就行。但是在 macOS 10.15 中光打开“允许任意来源”还是不够的，需要将 app 身上的一个扩展属性删掉。</p>
<h4 id="解决方式-1"><a href="#解决方式-1" class="headerlink" title="解决方式"></a>解决方式</h4><p>打开终端，输入，注意在 quarantine 之后有一个<strong>空格</strong></p>
<pre><code class="shell">sudo xattr -d com.apple.quarantine 
</code></pre>
<p>然后打开 finder，目录切换到应用程序，找到打不开的应用，拖入终端，回车。也会让你输入密码，输完回车。</p>
<p><img src="https://personal-1251959693.cos.ap-chengdu.myqcloud.com/2021-05-30-153659.png"></p>
<blockquote>
<p>苹果系统自 OSX 10.5 加入了一个叫 GateKeeper 保护机制，从互联网上下载来的文件，会被自动打上 com.apple.quarantine 标志，系统根据这个附加属性对这个文件作出限制。</p>
<p>macOS 10.14 即以下版本，安全限制还没这么严格，有这个属性的 app 需要确认才可执行，一旦被确认了，此属性就会被删掉。但 macOS 10.15 Catalina 对系统安全性大大的加强了，对于有这个 EA 的软件直接提示“已损坏”。</p>
</blockquote>

  </div>
  <div class="post-near">
    
    <a
      class="post-near-prev"
      href="/p/4d78f447.html"
      title="微信读书笔记导入 flomo"
    >
      <span class="arrow">←</span>
      <span class="post-near-title">
        微信读书笔记导入 flomo
      </span>
    </a>
    
    
    <a
      class="post-near-next"
      href="/p/20f2e93b.html"
      title="Kindle2Flomo"
    >
      <span class="post-near-title">
        Kindle2Flomo
      </span>
      <span class="arrow">→</span>
    </a>
    
  </div>
</article>

    <footer class="footer">
  <p>本博客采用 <a class="license-link" rel="license noopener" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">署名-非商业性使用-相同方式共享 4.0 国际</a>协议进行许可</p>
  <p>
    <span>Thanks For <a target="_blank" rel="noopener" href="https://github.com/nanxiaobei/hugo-paper" taget="_blank">hugo-paper</a></span>
    <span style="margin-left: 10px;">&copy; 2016-2025 by Tit1e</span>
  </p>
</footer>
    </div>
    <script src="//unpkg.com/@highlightjs/cdn-assets@11.5.0/highlight.min.js"></script>
<script>
  hljs.initHighlightingOnLoad();
  var _hmt = _hmt || [];
    (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?6349d3bc54baea0b04a65145c5e3b799";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
    })();
    const block = document.querySelectorAll('.post-content')[0]
    block.addEventListener('click', e => {
        const {nodeName, src} = e.target
        if(nodeName !== 'IMG') return
        document.body.classList.add('overflow-hidden')
        const div = document.createElement('div')
        div.id = 'global-cover'
        div.title = '点击关闭'
        const a = document.createElement('a')
        a.href = src
        a.target="_blank"
        a.title = '点击打开原图'
        const img = document.createElement('img')
        img.className = 'show-pic'
        img.src = src
        a.appendChild(img)
        div.appendChild(a)
        document.body.appendChild(div)
    })
    document.body.addEventListener('click', e => {
        if(e.target.id === 'global-cover'){
            document.body.classList.remove('overflow-hidden')
            document.body.removeChild(e.target)
        }
    })
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7M04VN3JZ4"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-7M04VN3JZ4');
</script>

<script src="/js/search.js"></script>


</body>
</html>